home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / general.programming / rec.games.hack_6075_000025.msg < prev   
Encoding:
Text File  |  1994-11-27  |  1009 b   |  37 lines

  1. Newsgroups: rec.games.hack
  2. Path: dd.chalmers.se!news.chalmers.se!sunic!EU.net!howland.reston.ans.net!agate!ames!ncar!uchinews!cdsmail!timbuk.cray.com!walter.cray.com!ned.cray.com!atl
  3. From: atl@cray.com (Anthony Laundrie  {x66591 CF/DEV})
  4. Subject: Easter calculation
  5. Message-ID: <1994Apr14.101837.9850@ned.cray.com>
  6. Lines: 26
  7. Nntp-Posting-Host: tofu.cray.com
  8. References: <2nb9v7$aqi@dscomsa.desy.de> <1994Mar31.083039.24113@martha.utcc.utk.edu> <2nk8cd$5ju@taco.cc.ncsu.edu>
  9. Date: 14 Apr 94 10:18:36 CDT
  10.  
  11.  
  12.    #include <stdio.h>
  13.  
  14.    easter(y)
  15.    int y;
  16.    /* prints the month/day for Easter in a given year */
  17.    {
  18.     int a,b,c,d,e,f,g,h,i,k,l,m,n,p;
  19.  
  20.     a = y % 19;
  21.     b = y / 100;
  22.     c = y % 100;
  23.     d = b / 4;
  24.     e = b % 4;
  25.     f = (b + 8) / 25;
  26.     g = (b  - f + 1) / 3;
  27.     h = (19*a + b - d - g + 15) % 30;
  28.     i = c / 4;
  29.     k = c % 4;
  30.     l = (32 + 2*e + 2*i - h - k) % 7;
  31.     m = (a + 11*h + 22*l) / 451;
  32.     n = (h + l - 7*m + 114) / 31;
  33.     p = (h + l - 7*m + 114) % 31;
  34.  
  35.     printf("%d/%d\n",n,p+1);
  36.    }
  37.